﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Grafica
{
    class ValidarLetrasNumeros
    {
        public static void ControlarNumeros(KeyPressEventArgs e) {
            if ((char.IsDigit(e.KeyChar)) || (char.IsControl(e.KeyChar)))
            {
                e.Handled = false;
            }else 
            {
                e.Handled = true;
            }
        }

        public static void ControlarLetras(KeyPressEventArgs e)
        {
            if ((char.IsLetter(e.KeyChar)) || (char.IsControl(e.KeyChar)))
            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }
        }
    }
}
